package edu.sctu.practice.class01.wangxiaoqiang.practice.two;


/**
 * Created by admin on 2015/10/9.
 */
public class Vehicle {

    int speed;
    float size;

    public void setValue() {
        size = (float) 2.0;
        System.out.println("大小是:" + size);
    }

    public void move() {
        System.out.println("这车跑的好快");
    }

    public int setSpeed(int speed) {
        System.out.println("速度是：" + speed);
        this.speed = speed;
        return speed;
    }

    public void speedUp() {
        int spd = setSpeed(speed);
        spd = spd + 100;
        System.out.println("增加后的速度是：" + spd);
    }

    public void speedDown() {
        int spd = setSpeed(speed);
        spd = spd - 100;
        System.out.println("减少后的速度是：" + spd);
    }
}
